home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14537 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: sooner.net!usenet
  2. From: Eddie Bush <edwbush@sooner.net>
  3. Newsgroups: comp.os.linux.misc,comp.lang.c++,gnu.gcc.help
  4. Subject: Re: Help: how do you redirect compile error to a file
  5. Date: Sun, 31 Mar 1996 04:08:56 -0800
  6. Organization: sooner.net news site
  7. Message-ID: <315E75D8.4317@sooner.net>
  8. References: <4igdeo$8tf@news.jhu.edu> <315B1BBF.43215860@soliton.creol.ucf.edu>
  9. NNTP-Posting-Host: p28.sooner.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win16; I)
  14.  
  15. Daniel-Marian Baboiu wrote:
  16. > yuehong wrote:
  17. > >
  18. > > I try to use the following command when I compile hello.cpp
  19. > > using gcc on linux:
  20. > >
  21. > > g++ hello.cpp >bug
  22. > >
  23. > > I thought error might be saved in bug. But, nothing there.
  24. > '>' redirects the standard output; the compiler errors are on the
  25. > standard error; it happens that both are mapped to the screen.
  26. > What you have to do is (if you are using bash as shell)
  27. > g++ hello.cpp >bug 2>&1
  28. > -------------------------------------------------
  29. > Daniel-Marian Baboiu
  30. > University of Central Florida / CREOL
  31. > 4000 Central Florida Blvd
  32. > Orlando, FL 32816-2700
  33. > 407-823-6919       Fax: 407-823-6955
  34. > e-mail: daniel@soliton.creol.ucf.edu
  35. > --------------------------------------------------
  36.  
  37. another handy way to do this is to generate a script file using (what 
  38. else) the script command.
  39.  
  40. This works like:
  41.  
  42. 1) type script
  43. 2) gcc file.c
  44. 3) type exit
  45.  
  46. The default name for the script is typescript, but if you add a name 
  47. parameter to script, you can change that (ie. "script errors" would 
  48. generate a script named errors) if you like.  This is a handy method - at 
  49. least it is to me.
  50.  
  51. This only works under Unix though - as far as I know.  Also - and someone 
  52. (like you won't) PLEASE correct me if I am wrong - this should work on 
  53. all UN*X machines.
  54.